package com.scaffold.myproject.model.req.item;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.domain.PageRequest;

/**
 * @author lx
 * @date 2025/11/4
 * @Description
 */

/**
 * Elasticsearch 商品分页查询请求
 */
@Data
@ApiModel("商品分页查询请求")
public class ItemPageReq{
    @ApiModelProperty(value = "商品名称（模糊匹配）", example = "脱脂牛奶")
    private String name;

    @ApiModelProperty(value = "商品类别（模糊匹配）", example = "牛奶")
    private String category;

    @ApiModelProperty(value = "品牌过滤条件", example = "德亚")
    private String brand;

    @ApiModelProperty(value = "最低价格（单位：分）", example = "1000")
    private Integer minPrice;

    @ApiModelProperty(value = "最高价格（单位：分）", example = "30000")
    private Integer maxPrice;

    @ApiModelProperty(
            value = "排序字段，可选值：price（价格）、sold（销量）、createTime（上架时间）",
            allowableValues = "price,sold,createTime",
            example = "price"
    )
    private String sortField = "price";

    @ApiModelProperty(value = "排序方式（asc升序 / desc降序）", allowableValues = "asc,desc", example = "asc")
    private String sortOrder = "asc";

    @ApiModelProperty(value = "当前页码（从1开始）", example = "1")
    private int pageNo = 1;

    @ApiModelProperty(value = "每页条数", example = "10")
    private int pageSize = 10;
}
